function colorea(){
    document.passForm.Password1.style.borderColor="#5f870e";
}
function checkPass(){
    var password1=document.getElementById('Password1').value;
    var password2=document.getElementById('Password2').value;
    if(password1===password2)
    {
        document.passForm.Password2.style.borderColor="#5f870e";
        return true;
    }
    else
    {
        document.passForm.Password2.style.borderColor="#FF0000";
        
        return false;
   }
    
}

function validar(){
    var camposNulos=document.getElementById('Password1').value;
    if(checkPass())
    {
        if(camposNulos!=""){document.getElementById('passForm').submit();}
        {alert("Ups! parece q no escribiste nada en los campos :C\nintenta de nuevo :)");}
    }
    else
    {
        alert("las contraseñas que ingresaste\nson distintas");
    }
}

function validaEmail(inputT){
   if(/^[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}$/i.test(inputT.value))
        {
             inputT.style.borderColor="#5f870e";
             return true;
        }
    else
        {
             inputT.style.borderColor="#FF0000";
             return false;
        }
}


function toMinus(inputT){
    inputT.value=inputT.value.toLowerCase();
}

function cambiaColor(inputT){
  inputT.style.borderColor="#5f870e";
}


function validarContacto(){
    if(validaEmail(document.email.destino)&&
        document.email.asunto.value!=""&&
        document.email.comment.value!=""){
        document.getElementById('email').submit();
    }
    else{
        alert("Por favor llena correctamente los campos");
    }
}